﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FlowThruApportionmentRule.aspx.cs"
    Inherits="WMS6.Web.CrossDock.FlowThruAllocation" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>FlowThruApportionmentRule</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/Verification.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script src="../Js/calendar.js" type="text/javascript" charset="gb2312"></script>

    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            initEditNewPage();
        }
        
        function newFlowThruApportionmentRule()
        {
            var from = document.getElementById("hdnFrom").value;
            window.location.href = "FlowThruApportionmentRule.aspx?from=" + from;
            return false;
        }
        
       
        //弹出窗口选择货主
        function selectOwner()
        {
            var rtnValue = popModalWindow('../Configuration/OwnerQuery.aspx?action=txtOwnerID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtOwnerID").focus();
                document.getElementById("txtOwnerID").value = rtnValue;
            }
        }
      	
		function confirmMsg(code) {
		    if (code == "F4100_001") {
		        if (confirm('<%=GetGlobalMsgResource("F4100_001") %>')) {
		            return true;
		        }
		        else {
		            return false;
		        }
		    }
		}
    </script>

</head>
<body>
    <form id="F79621" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblApportionmentRule" runat="server" CssClass="label_header" Text="直通分配规则"
                            meta:resourcekey="lblOwner"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnGoBack%>"
                            CausesValidation="False" OnClick="btnGoBack_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnNew%>"
                            AccessKey="n" OnClientClick="newFlowThruApportionmentRule();return false;" />
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDelete%>"
                            AccessKey="d" OnClientClick="javascript:if(confirmMsg('F4100_001')) return true; else return false;"
                            OnClick="btnDelete_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnCopy" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnCopy%>"
                            AccessKey="c" OnClick="btnCopy_Click" />
                    </td>
                   
                </tr>
            </table>
        </div>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div>
                    <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
                </div>
                <div id="div_menu">
                    <div style="float: left; width: 8px;">
                        <div class="tabL" id="divL1">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur" onclick="setTab('one',1,2)"
                        id="divM1">
                        <asp:Label ID="one1" CssClass="hover" runat="server">常规</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR" id="divR1">
                        </div>
                    </div>
                    <div style="float: left; width: 8px;">
                        <div class="tabL_1" id="divL2">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,2);"
                        id="divM2">
                        <asp:Label ID="one2" CssClass="navigationlabel" runat="server">&nbsp;客户&nbsp;</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR_1" id="divR2">
                        </div>
                    </div>
                </div>
                <div id="div_content">
                    <div id="con_one_1" style="display: block;">
                        <table width="720px" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td width="180px">
                                    <asp:Label ID="lblOwnerID" CssClass="label" runat="server" Text="货主"></asp:Label>
                                </td>
                                <td width="180px">
                                    &nbsp;
                                </td>
                                <td width="180px">
                                    &nbsp;
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:TextBox ID="txtOwnerID" runat="server" CssClass="textbox" MaxLength="20"></asp:TextBox><img src="../Images/icon_find.gif" id="imgOwnerID" runat="server" alt="select one item" class="img" onclick="selectOwner();"/>
                                </td>
                                <td width="180px">
                                    &nbsp;
                                </td>
                                <td width="180px">
                                    &nbsp;
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td width="180px">
                                    <asp:Label ID="lblOwner" CssClass="label" runat="server" Text="货主名称"></asp:Label>
                                </td>
                                <td width="180px">
                                </td>
                                <td width="180px">
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td width="180px" colspan="2">
                                    <asp:TextBox ID="txtOwner" runat="server" CssClass="largetextbox" MaxLength="20"></asp:TextBox>
                                </td>
                                <td width="180px">
                                </td>
                                <td width="180px">
                                </td>
                                <td width="180px">
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lbl" runat="server" Text="直通分配规则" CssClass="label"></asp:Label>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:DropDownList ID="ddl" runat="server" CssClass="mediumselectbox">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr style="height:10px">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="con_one_2" style="display: none; overflow-x: auto; overflow-y: hidden;">
                        <table width="1080px" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Button ID="btnAddDetail" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnAddDetail%>"
                                                    OnClick="btnAddDetail_Click" />
                                            </td>
                                            <td>
                                                <asp:Button ID="btnDeleteDetail" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDeleteDetail%>"
                                                    OnClientClick="javascript:if(confirm('确定要删除这几条明细吗?')) return true; else return false;"
                                                    OnClick="btnDeleteDetail_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        <asp:GridView ID="gvApportionmentRule" runat="server" AutoGenerateColumns="False"
                                            CssClass="gridview" DataKeyNames="OWNERID,CUSTOMERID,SEQNO" PageSize="20" oninit="gvApportionmentRule_Init" 
                                            AllowSorting="True" onrowdatabound="gvApportionmentRule_RowDataBound">
                                            <FooterStyle CssClass="GridViewFooterStyle" />
                                            <RowStyle CssClass="GridViewRowStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                            <Columns>
                                                <asp:BoundField HeaderText="序号" FooterText="序号">
                                                    <ItemStyle CssClass="GridViewRowWidth_40" />
                                                </asp:BoundField>
                                                <asp:TemplateField>
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvApportionmentRule');" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chbSelect" runat="server" meta:resourceKey="chbSelect" />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvEquipmentType');" />
                                                    </FooterTemplate>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                                    <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="CUSTOMERID" HeaderText="客户" FooterText="客户" SortExpression="CUSTOMERID">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="SEQNO" HeaderText="序号" FooterText="序号" SortExpression="SEQNO">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="ALLOWOVERSHIPMENT" HeaderText="允许超量出货" FooterText="允许超量出货"
                                                    SortExpression="ALLOWOVERSHIPMENT">
                                                    <ItemStyle CssClass="GridViewRowWidth_150" />
                                                </asp:BoundField>
                                                                                                
                                                <asp:TemplateField FooterText="百分比上限" HeaderText="百分比上限" SortExpression="MAXIMUMPEROVER" >
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblQty" runat="server" 
                                                            Text='<%# GetPreferenceDigit(Eval("MAXIMUMPEROVER").ToString()) %>' ></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:TemplateField>
                                                
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr style="height: 30px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <input type="hidden" id="hiddenFlag" />
            </ContentTemplate>

        </asp:UpdatePanel>
        <input type="hidden" id="hdnFrom" runat="server" />
        <input type="hidden" id="hdnOwnerID" runat="server" />
        <input type="hidden" id="hdnDataFormat" runat="server" />
        <input type="hidden" id="hdncalendarFlag" runat="server" />
    </div>
    </form>
</body>
</html>
